Update text per comment in pull request.
authorStephen Becker IV <github@deathbyescalator.com>
Sun, 17 May 2015 16:01:50 +0000 (09:01 -0700)
committerStephen Becker IV <github@deathbyescalator.com>
Sun, 17 May 2015 16:01:50 +0000 (09:01 -0700)
Better error message with details around lib and bin.

src/cargo/util/toml.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_custom_build.rs

index 5cbefe5662c642e44e8496fda8a9117e35694f67..485cc5b0944770ad575daa8c384aca07b85b68db 100644 (file)
@@ -118,8 +118,9 @@ pub fn to_manifest(contents: &[u8],
         None => {}
     }
     if !manifest.targets().iter().any(|t| !t.is_custom_build()) {
-        return Err(human(format!("either a [lib] (lib.rs) or [[bin]] (main.rs) section must \
-                                  be present in src")))
+        return Err(human(format!("no targets specified in the manifest \neither \
+                                  src/lib.rs, src/main.rs, a [lib] section, or [[bin]] \
+                                  section must be present")))
     }
     return Ok((manifest, paths));
 
index aa18699dcf004d2f47152d7792d9acf3cf2088ce..309f445dcc4d6bae766ac507b5bade50634b2f5e 100644 (file)
@@ -794,7 +794,9 @@ test!(missing_lib_and_bin {
 failed to parse manifest at `[..]Cargo.toml`
 
 Caused by:
-  either a [lib] (lib.rs) or [[bin]] (main.rs) section must be present in src\n"));
+  no targets specified in the manifest
+
+  either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present\n"));
 });
 
 test!(lto_build {
index 51d1843306e8ab7a6c0e15833ef1d785d0226fc0..0a9789751592b07cc30d7be82abfa38552403420 100644 (file)
@@ -953,7 +953,9 @@ test!(build_script_only {
 failed to parse manifest at `[..]`
 
 Caused by:
-  either a [lib] (lib.rs) or [[bin]] (main.rs) section must be present in src"));
+  no targets specified in the manifest
+
+  either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present"));
 });
 
 test!(shared_dep_with_a_build_script {